package org.liulinlin.sejw.db;

import java.sql.*;

public class CYInfo {
	private String id;
	private String fullTitle;
	private String name;
	private String owner;
	private String logFund;
	private String manager;
	private String addr;
	private String zip;
	private String tel;
	private String fax;
	private String email;
	private String bankName;
	private String account;
	private String contact;
	private String pos;
	private boolean gender;
	private String offAddr;
	private String offTel;
	private String homeAddr;
	private String homeTel;
	private String homeFax;
	
	public CYInfo() {
		
	}
	public CYInfo(String id) {
		DBConnectionManager connMgr = DBConnectionManager.getInstance();
		Connection con = connMgr.getConnection("shipping_export");
		if (con == null) {
			System.out.println("CYInfo不能获得数据库连接");
			return;
		}
		
		try {
			Statement stmt = con.createStatement();
			ResultSet rs = stmt.executeQuery("select * from CYInfo where CY_ID = '" + id + "'");
			
			rs.next();
			id = this.id;
			fullTitle = rs.getString("CY_FullTitle");
			name = rs.getString("CY_Name");
			owner = rs.getString("CY_Owner");
			logFund = rs.getString("CY_LogFund");
			manager = rs.getString("CY_Manager");
			addr = rs.getString("CY_Addr");
			zip = rs.getString("CY_Zip");
			tel = rs.getString("CY_Tel");
			fax = rs.getString("CY_Fax");
			email = rs.getString("CY_Email");
			bankName = rs.getString("CY_BankName");
			account = rs.getString("CY_Account");
			contact = rs.getString("CY_Contact");
			pos = rs.getString("CY_Pos");
			gender = rs.getBoolean("CY_Gender");
			offAddr = rs.getString("CY_OffAddr");
			offTel = rs.getString("CY_OffTel");
			homeAddr = rs.getString("CY_HomeAddr");
			homeTel = rs.getString("CY_HomeTel");
			homeFax = rs.getString("CY_HomeFax");
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		connMgr.freeConnection("shipping_export", con);
		connMgr.release();
	}
	
	public void setId(String id) {
		this.id = id;
	}
	public void setFullTitle(String fullTitle) {
		this.fullTitle = fullTitle;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setOwner(String owner) {
		this.owner = owner;
	}
	public void setLogFund(String logFund) {
		this.logFund = logFund;
	}
	public void setManager(String manager) {
		this.manager = manager;
	}
	public void setAddr(String addr) {
		this.addr = addr;
	}
	public void setZip(String zip) {
		this.zip = zip;
	}
	public void setTel(String tel) {
		this.tel = tel;
	}
	public void setFax(String fax) {
		this.fax = fax;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public void setBankName(String bankName) {
		this.bankName = bankName;
	}
	public void setAccount(String account) {
		this.account = account;
	}
	public void setContact(String contact) {
		this.contact = contact;
	}
	public void setPos(String pos) {
		this.pos = pos;
	}
	public void setGender(boolean gender) {
		this.gender = gender;
	}
	public void setOffAddr(String offAddr) {
		this.offAddr = offAddr;
	}
	public void setOffTel(String offTel) {
		this.offTel = offTel;
	}
	public void setHomeAddr(String homeAddr) {
		this.homeAddr = homeAddr;
	}
	public void setHomeTel(String homeTel) {
		this.homeTel = homeTel;
	}
	public void setHomeFax(String homeFax) {
		this.homeFax = homeFax;
	}
	
	public String getId() {
		return id;
	}
	public String getFullTitle() {
		return fullTitle;
	}
	public String getName() {
		return name;
	}
	public String getOwner() {
		return owner;
	}
	public String getLogFund() {
		return logFund;
	}
	public String getManager() {
		return manager;
	}
	public String getAddr() {
		return addr;
	}
	public String getZip() {
		return zip;
	}
	public String getTel() {
		return tel;
	}
	public String getFax() {
		return fax;
	}
	public String getEmail() {
		return email;
	}
	public String getBankName() {
		return bankName;
	}
	public String getAccount() {
		return account;
	}
	public String getContact() {
		return contact;
	}
	public String getPos() {
		return pos;	
	}
	public boolean getGender() {
		return gender;
	}
	public String getOffAddr() {
		return offAddr;
	}
	public String getOffTel() {
		return offTel;
	}
	public String getHomeAddr() {
		return homeAddr;
	}
	public String getHomeTel() {
		return homeTel;
	}
	public String getHomeFax() {
		return homeFax;
	}
}
